<?php

/**
 * permissions table
 *
 * @author     Mon Zafra <monzee at gmail>
 * @copyright  (c)2009 Mon Zafra
 * @category   Mz
 * @package    modules
 * @subpackage admin
 * @license    http://mz-project.googlecode.com/svn/trunk/LICENSE    MIT License
 * @version    SVN: $Id: Permission.php 29 2009-05-14 15:35:03Z monzee $
 */
class Admin_Model_DbTable_Permission extends Zend_Db_Table_Abstract
{
    protected $_name = 'permissions';

    public function getRulesFor($resId)
    {
        $sel = $this->select();
        if (null === $resId) {
            $sel->where('resource_id IS NULL');
        } else {
            $sel->where('resource_id = ?', $resId);
        }
        $ret = $this->fetchAll($sel);
        return $ret;
    }


}